import request from '@/utils/request'

/**
 * 后端登录接口

 * @param {Object} data
 */
export function login(data) {
  return request({
    url: '/passport/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/users/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

/**
 * 登出的后端接口
 */
export function loginOut() {
  return request({
    url: '/passport/loginOut',
    method: 'get'
  })
}
